package work.ib.apt.perf.complex;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import work.ib.apt.perf.TestMain;

public class NearbyComplexes extends TestMain {

//	private static final String url = "http://localhost:8000/services/complexes/v1/getNearComplexes";
	private static final String url = "http://dev-aptratings-services1.internetbrands.com:8080/services/complexes/v1/getNearComplexes";

	private static final Integer parallelThreads = 5;

	private static long[] complexIdDev = new long[] {
		 9199332346275146272l,
		 9199332346275151765l,
		 9199332346275152192l,
		 9199332346275152882l,
		 9199332346275152891l,
		 9199332346275152894l,
		 9199332346275152899l,
		 9199332346275152905l,
		 9199332346275152981l,
		 9199332346275152983l,
		 9199332346275152984l,
		 9199332346275153001l,
		 9199332346275153011l,
		 9199332346275153829l,
		 9199332346275154004l,
		 9199332346275154484l,
		 9199332346275154562l,
		 9199332346275152559l,
		 9199332346275152566l,
		 9199332346275152572l,
		 9199332346275154037l,
		 9199332346275154038l,
		 9199332346275154039l,
		 9199332346275154040l,
		 9199332346275154041l,
		 9199332346275154042l,
		 9199332346275154043l,
		 9199332346275154044l,
		 9199332346275154045l,
		 9199332346275154046l,
		 9199332346275154047l,
		 9199332346275154067l,
		 9199332346275154068l,
		 9199332346275154069l,
		 9199332346275154070l,
		 9199332346275154071l,
		 9199332346275154072l,
		 9199332346275154073l,
		 9199332346275154074l,
		 9199332346275154075l,
		 3101234567l,
		 121333399950l,
		 555121299950l,
		 1000000012345l,
		 2534642123451l,
		 5464341123451l,
		 6323442123451l,
		 6796310123451l,
		 9071234599503l,
		 310280600512345l,
		 310280600598765l,
		 817540006099701l,
		 888503586499503l,
		 907225345199901l,
		 907225346099901l,
		 907225373999901l,
		 907225379599901l,
		 907225603099901l,
		 907225867299901l,
		 907235563999603l,
		 907235592099603l,
		 907243267399517l,
		 907243435199517l,
		 907258229399507l,
		 907258390099503l,
		 907258585599508l,
		 907262140799669l,
		 907262171099669l,
		 907262582099669l,
		 907262705599669l,
		 907262844899669l,
		 907262923899669l,
		 907272012699503l,
		 907272210699501l,
		 907272259199501l,
		 907272566599501l,
		 907274001599503l,
		 907274637199503l,
		 907276237799501l,
		 907277018599501l,
		 907277240099508l,
		 907277956499501l,
		 907278354099501l,
		 907279160099501l,
		 907279160199501l,
		 907283300599611l,
		 907333962499508l,
		 907337191199504l,
		 907337483399504l,
		 907337531299508l,
		 907337641099508l,
		 907337743499508l,
		 907338354299504l,
		 907338484399504l,
		 907344330099518l,
		 907349378499515l,
		 907356161699701l,
		 907357025699654l,
		 907357960599654l,
		 907364313099801l,

	};

	private static long[] complexIdLocal = new long[] {
		1830
	};

	public static void main(String[] args) {
		try {
			new NearbyComplexes().runTest();
		} catch (Exception e) {
			e.printStackTrace(System.out);
		}
	}

	@Override
	public Map<String, Object> getParameters() {
		int distance = 100;
		int maxComplexReturned = 6;
		long[] dataArray = complexIdDev;
		long complexId = dataArray[new Random().nextInt(dataArray.length)];
		Map<String,Object> params = new HashMap<String,Object>();

		params.put("complexId", complexId);
		params.put("distance", distance);
		params.put("maxComplexReturned", maxComplexReturned);
		params.put("format", "json");

		return params;
	}

	@Override
	public int getParallelThreads() {
		return parallelThreads;
	}

	@Override
	public String getURL() {
		return url;
	}
}
